package main

import "fmt"

//匿名函数
func main() {
	a := func() {
		fmt.Println("func AAAA")
	}
	a()

	f := closure(10)
	fmt.Println(f(1))
	fmt.Println(f(2))
}

//闭包操作
func closure(x int) func(int) int{
	return func(y int) int {
		return x + y
	}
}